import { shallowRef, computed } from 'vue';
import transform from './transform';
// import { useMatchSomeAccess } from '../access/useAccess';

function useColumns(columns, opts) {
  const { ...config } = opts || {};

  const source = shallowRef(columns);

  // 渲染处理
  const data = computed(() => {
    return transform(source.value, config);
  });

  // 可以通过 source 进行中间处理
  return { source, data };
}

export default useColumns;
